<input type="hidden" id="limitcity" value="{$config['limitcity']}">
<input type="hidden" id="url" value="{$config['url']}">
{if !empty($system['bdapi'])}
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak={$system['bdapi']}&s=1"></script>
<script type="text/javascript">
var limitcity = $("#limitcity").val()+'市';
var cityurl = "{$config['url']}";
var geolocation = new BMap.Geolocation();
var geoc = new BMap.Geocoder();
geolocation.getCurrentPosition(function(r){
	if(this.getStatus() == BMAP_STATUS_SUCCESS){
		var point = new BMap.Point(r.point.lng,r.point.lat);
		geoc.getLocation(point, function(rs){
			var addComp = rs.addressComponents;
			//console.log(addComp);
			if(addComp.city != limitcity){
                if(cityurl !=""){
                    tips2('活动地区限'+limitcity+',当前在'+addComp.province+addComp.city,cityurl);
                }else{
                    $("#light").hide();
                    $(".content").hide();
                }
			}else{
                    $("#light").show();
                }
		}); 
	}
	else {
        if(cityurl !=""){
            tips2('活动地区限'+limitcity,cityurl);
        }
        $("#light").hide();
        $(".content").hide();
	}        
},{enableHighAccuracy: true})
</script>
{/if}